import pytest

def add(x,y):
    return x+y
def build_data():
    data=[
        (1, 1, 2),
        (1, 2, 3)
    ]
    return data

class TestAdd:


    @pytest.mark.parametrize('a,b,expect',build_data())
    def test_add(self,a,b,expect):
        result = add(a,b)
        assert result == expect
if __name__ == '__main__':
    pytest.main(['-s','hm_10_参数化_方法3.py'])